package com.xxx.modules.sys.controller;

import com.xxx.modules.sys.domain.SysUserDomain;
import org.apache.shiro.SecurityUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

/** 公共Controller
 * Created by ChenXuefei on 2017/10/13.
 */
public abstract class AbstractController {
    protected Logger logger = LoggerFactory.getLogger(getClass());

    protected static SysUserDomain getUser() {
        return (SysUserDomain) SecurityUtils.getSubject().getPrincipal();
    }

    protected static Long getUserId() {
        return getUser().getUserId();
    }
}
